<? if(!defined('IN_DISCUZ')) exit('Access Denied'); include template('header'); ?>
<div id="nav"><a href="<?=$indexname?>"><?=$bbname?></a> &raquo;
		<? if($operation == 'uselog') { ?>
			道具使用记录
		<? } elseif($operation == 'buylog') { ?>
			道具购买记录
		<? } elseif($operation == 'givelog') { ?>
			道具赠送记录
		<? } elseif($operation == 'receivelog') { ?>
			道具获赠记录
		<? } elseif($operation == 'marketlog') { ?>
			道具市场记录
		<? } ?>
	</div>
	<div class="container">
		<div class="side">
<? include template('magic_navbar'); ?>
</div>
		<div class="content">
			<? if(!$magicstatus && $adminid == 1) { ?>
				<div class="notice">道具系统已关闭，仅管理员可以正常使用</div>
			<? } ?>
			<? if($operation == 'uselog') { ?>
				<div class="mainbox">
					<h1>道具使用记录</h1>
					<table summary="道具使用记录" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>名称</td>
								<td class="time">使用时间</td>
								<td>使用对象</td>
							</tr>
						</thead>
						<? if($loglist) { if(is_array($loglist)) { foreach($loglist as $log) { ?>								<tr>
									<td><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=<?=$log['magicid']?>" target="_blank"><?=$log['name']?></a></td>
									<td class="time"><?=$log['dateline']?></td>
									<td><? if($log['target']) { ?><a href="<?=$log['target']?>" target="_blank">查看对象</a><? } else { ?>丢弃<? } ?></td>
								</tr>
							<? } } } else { ?>
							<tr><td colspan="3">没有相关记录</td></tr>
						<? } ?>
					</table>
				</div>
				<? if(!empty($multipage)) { ?><div class="pages_btns"><?=$multipage?></div><? } ?>
			<? } elseif($operation == 'buylog') { ?>
				<div class="mainbox">
					<h1>道具购买记录</h1>
					<table summary="道具购买记录" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>名称</td>
								<td class="time">购买时间</td>
								<td class="nums">购买数量</td>
								<td>购买价格</td>
							</tr>
						</thead>
						<? if($loglist) { if(is_array($loglist)) { foreach($loglist as $log) { ?>								<tr>
									<td><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=<?=$log['magicid']?>" target="_blank"><?=$log['name']?></a></td>
									<td class="time"><?=$log['dateline']?></td>
									<td class="nums"><?=$log['amount']?></td>
									<td><?=$log['price']?> <?=$extcredits[$creditstrans]['title']?></td>
								</tr>
							<? } } } else { ?>
							<tr><td colspan="4">没有相关记录</td></tr>
						<? } ?>
					</table>
				</div>
				<? if(!empty($multipage)) { ?><div class="pages_btns"><?=$multipage?></div><? } ?>
			<? } elseif($operation == 'givelog') { ?>
				<div class="mainbox">
					<h1>道具赠送记录</h1>
					<table summary="道具赠送记录" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>名称</td>
								<td class="time">赠送时间</td>
								<td class="nums">赠送数量</td>
								<td class="user">赠送对象用户名</td>
							</tr>
						</thead>
						<? if($loglist) { if(is_array($loglist)) { foreach($loglist as $log) { ?>								<tr>
									<td><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=<?=$log['magicid']?>" target="_blank"><?=$log['name']?></a></td>
									<td class="time"><?=$log['dateline']?></td>
									<td class="nums"><?=$log['amount']?></td>
									<td class="auser"><a href="space.php?action=viewpro&amp;uid=<?=$log['targetuid']?>" target="_blank"><?=$log['username']?></a></td>
								</tr>
							<? } } } else { ?>
							<tr><td colspan="5">没有相关记录</td></tr>
						<? } ?>
					</table>
				</div>
				<? if(!empty($multipage)) { ?><div class="pages_btns"><?=$multipage?></div><? } ?>
			<? } elseif($operation == 'receivelog') { ?>
				<div class="mainbox">
					<h1>道具获赠记录</h1>
					<table summary="道具获赠记录" cellspacing="0" cellpadding="0">
					<thead>
						<tr>
							<td>名称</td>
							<td class="time">获赠时间</td>
							<td class="nums">获赠数量</td>
							<td class="auser">赠送人</td>
						</tr>
					</thead>
					<? if($loglist) { if(is_array($loglist)) { foreach($loglist as $log) { ?>							<tr>
								<td><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=<?=$log['magicid']?>" target="_blank"><?=$log['name']?></a></td>
								<td class="time"><?=$log['dateline']?></td>
								<td class="nums"><?=$log['amount']?></td>
								<td class="user"><a href="space.php?action=viewpro&amp;uid=<?=$log['targetuid']?>" target="_blank"><?=$log['username']?></a></td>
							</tr>
						<? } } } else { ?>
						<tr><td colspan="4">没有相关记录</td></tr>
					<? } ?>
					</table>
				</div>
				<? if(!empty($multipage)) { ?><div class="pages_btns"><?=$multipage?></div><? } ?>
			<? } elseif($operation == 'marketlog') { ?>
				<div class="mainbox">
					<h1>道具市场记录</h1>
					<table summary="道具市场记录" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>名称</td>
								<td class="time">操作时间</td>
								<td class="nums">操作数量</td>
								<td>操作价格</td>
								<td>操作</td>
							</tr>
						</thead>
						<? if($loglist) { if(is_array($loglist)) { foreach($loglist as $log) { ?>								<tr>
									<td><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=<?=$log['magicid']?>" target="_blank"><?=$log['name']?></a></td>
									<td class="time"><?=$log['dateline']?></td>
									<td class="nums"><?=$log['amount']?></td>
									<td><?=$log['price']?> <?=$extcredits[$creditstrans]['title']?></td>
									<td><? if($log['action'] == '4') { ?>出售<? } elseif($log['action'] == '5') { ?>购买<? } elseif($log['action'] == '6') { ?>撤下<? } ?></td>
								</tr>
							<? } } } else { ?>
							<tr><td colspan="4">没有相关记录</td></tr>
						<? } ?>
					</table>
				</div>
				<? if(!empty($multipage)) { ?><div class="pages_btns"><?=$multipage?></div><? } ?>
			<? } ?>
		</div>
	</div>
<? include template('footer'); ?>
